import java.util.Scanner;

public class homework01 {
    public static void main(String[] args) {
        int[] mm={31,28,31,30,31,30,31,31,30,31,30,31};//十二月份
        int sum = 0;//计算此年的天数
        Scanner input = new Scanner(System.in);
        System.out.println("请输入某年某月某日：");
        System.out.print("年：");
        int year= input.nextInt();
        System.out.print("月：");
        int m= input.nextInt();
        System.out.print("日：");
        int d=input.nextInt();
        if((year % 4 == 0 && year % 100 != 0)||(year % 400 == 0)){
            for(int i = m-1; i > 0;i--) {
                sum =sum + mm[i-1];
            }
            if(m > 2) {
                sum += 1;//闰年2月多一天
            }
        }
        else {
            for(int i = m-1; i > 0;i--) {
                sum =sum + mm[i-1];
            }
        }
        sum += d;//月份的天数加上日子的天数
        System.out.println(year + "年" + m + "月" + d + "日" + "是这一年的第" + sum + "天");
    }
}
